using System;
using System.Collections.Generic;
using System.Text;
using TaugeLibrary.Classes;

namespace TaugeLibrary.Classes.Attributes
{
    /*
    [AttributeUsage(AttributeTargets.Class |
         AttributeTargets.Constructor |
         AttributeTargets.Field |
         AttributeTargets.Method |
         AttributeTargets.Property,
         AllowMultiple = true)]
     * */

    [AttributeUsage(AttributeTargets.Class |
         AttributeTargets.Constructor |
         AttributeTargets.Field |
         AttributeTargets.Method |
         AttributeTargets.Property,
         AllowMultiple = true)]
    public class AttArr : System.Attribute
    {
        string m_arrname;
        string[] m_stritems;

        public string ArrName { set { m_arrname = value; } get { return m_arrname; } }
        public string[] StrItems { set { m_stritems = value; } get { return m_stritems; } }
    }

    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
    public class AttBu : System.Attribute
    {
        private string m_tablename;
        private string[] m_primarykeys;
        //private string[] m_quickdatapkeys;

        private string[] m_datapkeys;
        private string[] m_datapsets;


        private string[] m_proppkeys;
        private string[] m_proppsets;


        private string m_querysql;
        private string m_dbtype = LibConstants.DBDATA;


        public string TableName { set { m_tablename = value; } get { return m_tablename; } }
        public string[] PrimaryKeys { set { m_primarykeys = value; } get { return m_primarykeys; } }

        public string[] DataPSets { set { m_datapsets = value; } get { return m_datapsets; } }
        public string[] DataPKeys { set { m_datapkeys = value; } get { return m_datapkeys; } }

        public string[] PropPSets { set { m_proppsets = value; } get { return m_proppsets; } }
        public string[] PropPKeys { set { m_proppkeys = value; } get { return m_proppkeys; } }

        public string QuerySql { set { m_querysql = value; } get { return m_querysql; } }

        public string DBType { set { m_dbtype = value; } get { return m_dbtype; } }

    }

    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
    public class AttBuMgr : System.Attribute
    {

        private string m_unitname;
        
        private string m_unit;
        private string[] m_listhiddencolumns;                
        private string m_image_res = "";

        //new
        private string m_unitui;
        private string m_dbtype = LibConstants.DBDATA;
        private string m_dllfile = "";
        private string[] m_list_columns = null;
        private string[] m_list_tables = null;
        private string[] m_list_keys = null;
        private bool m_list_is_distinct = false;
        private string m_list_fixed_condition = "";
        private string[] m_list_conditions = null;
        private string[] m_list_orders = null;

        //deprecated
        //private string m_unitform;
        //private string m_listsql;
        //private string m_searchbox;
        //private string[] m_searchfields;
        //private string[] m_searchdescriptions;
        //private eFieldType[] m_searchtypes;
        
        //gray area
        public string Unit { set { m_unit = value; } get { return m_unit; } }
        public string ImageRes { set { m_image_res = value; } get { return m_image_res; } }
        //still used
        public string UnitName { set { m_unitname = value; } get { return m_unitname; } }
        public string[] ListHiddenColumns { set { m_listhiddencolumns = value; } get { return m_listhiddencolumns; } }
        
        //new
        public string UnitUI { set { m_unitui = value; } get { return m_unitui; } }
        public string DBType { set { m_dbtype = value; } get { return m_dbtype; } }
        public string DllFile { set { m_dllfile = value; } get { return m_dllfile; } }
        public string[] ListColumns { set { m_list_columns = value; } get { return m_list_columns; } }
        public string[] ListTables { set { m_list_tables = value; } get { return m_list_tables; } }
        public string[] ListKeys { set { m_list_keys = value; } get { return m_list_keys; } }
        public bool ListIsDistinct { set { m_list_is_distinct = value; } get { return m_list_is_distinct; } }
        public string[] ListConditions { set { m_list_conditions = value; } get { return m_list_conditions; } }
        public string[] ListOrders { set { m_list_orders = value; } get { return m_list_orders; } }
        public string ListFixedCondition { set { m_list_fixed_condition = value; } get { return m_list_fixed_condition; } }
        //deprecated
        //public string UnitForm { set { m_unitform = value; } get { return m_unitform; } }
        //public string ListSql { set { m_listsql = value; } get { return m_listsql; } }
        //public string SearchBox { set { m_searchbox = value; } get { return m_searchbox; } }
        //public string[] SearchFields { set { m_searchfields = value; } get { return m_searchfields; } }
        //public string[] SearchDescriptions { set { m_searchdescriptions = value; } get { return m_searchdescriptions; } }
        //public eFieldType[] SearchTypes { set { m_searchtypes = value; } get { return m_searchtypes; } }
        
    }


    [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
    class AttBuProp : System.Attribute
    {
        //private string m_fieldname;
        //private bool m_istimestamp=false;


    }
}
